package com.hnqcgczy.shop.service.impl;

import com.hnqcgczy.shop.dao.IProductDao;
import com.hnqcgczy.shop.dao.impl.ProductDaoimpl;
import com.hnqcgczy.shop.service.IProductService;
import com.hnqcgczy.shop.vo.TProduct;

import java.sql.SQLException;
import java.util.List;

public class ProductServiceimpl implements IProductService {
    private  IProductDao productDao;

    public ProductServiceimpl(IProductDao productDao) {
        this.productDao = productDao;
    }

    @Override
    public List<TProduct> listAll() throws SQLException {
        List<TProduct> list = productDao.listAll();
        return list;
    }

    @Override
    public List<TProduct> querAny(TProduct Product, int page, int pageSize) throws SQLException {
        List<TProduct> list = productDao.querAny(Product, page, pageSize);
        return list;
    }

    @Override
    public TProduct querByID(int tp_id) throws SQLException {
        TProduct tProduct=productDao.querByID(tp_id);
        return tProduct;
    }
}
